package com.dezheyun.controller;


import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HollerController {

    @PreAuthorize(value = "hasRole('ROOT')")  //区分大小写
    @GetMapping("/query")
    public String getInfo() {
        //获取用户信息
       // SecurityContextHolder.getContext().getAuthentication().toString();
       return "query ...";
    }

    @PreAuthorize(value = "hasRole('test')")
    @GetMapping("/save")
    public String save() {
        return "save ... ";
    }

}
